package com.njtoyo.taxi.admin.rest.export.taxis;

import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;

import java.util.Date;

@Data
@ColumnWidth(60)
public class TaxisListData {
    @ExcelProperty(value = "车辆ID")
    private Long id;

    @ExcelProperty(value = "车牌号")
    private String plateNumber;

    @ExcelProperty(value = "发动机号")
    private String serialNumber;

    @ExcelProperty(value = "是否报废")
    private String isScrapped;
    @ExcelIgnore
    private Long cantonId;

    @ExcelProperty(value = "地区")
    private String cantonName;

    @ExcelProperty(value = "公司名称")
    private String companyName;

    @ExcelProperty(value = "车辆坐标最后更新的时间")
    private String lastLocateTimestamp;

    @ExcelProperty(value = "创建时间")
    @DateTimeFormat(DatePattern.NORM_DATETIME_PATTERN)
    private Date createdAt;

    @ExcelProperty(value = "修改时间")
    @DateTimeFormat(DatePattern.NORM_DATETIME_PATTERN)
    private Date updatedAt;

    public void setIsScrapped(Boolean isScrapped) {
        this.isScrapped = isScrapped ? "报废" : "正常";
    }
}
